<template>
  <svg class="svg-icon" aria-hidden="true" :style="{'height': props.size+'em','width': props.size+'em'}">
    <use :xlink:href="iconName" :fill="props.color" />
  </svg>
</template>
<script setup>
import { computed } from 'vue';

const props = defineProps({
  name: {
    type: String,
    required: true
  },
  color: {
    type: String,
    default: ''
  },
  size: {
    type: String,
    default: '1.2'
  }
});

const iconName = computed(() => `#icon-${props.name}`);

</script>

<style scoped lang="scss">
.svg-icon {
  fill: currentColor;
  vertical-align: -2px;
}
</style>
